<div id="recommend">
	<div class="recommend_top"></div>
	<img src="images/title07.png" width="200" height="23" />	
	<?php
	if($rowTable){
		foreach($rowTable as $row){
			if($row->status==1){
				$url = '###';
				$span = '<span></span>';
			}else{
				$url = Yii::app()->createUrl('activity/detail',array('id'=>$row->activityid));
				$span = '';
			}
	?>
	<div class="recommendBOX">
		<a href="<?=$url?>">
		<div class="recommendBOX_name">
			<table width="100%" border="0">
				<tr height="38">
					<td valign="middle"><?=$row->activityname?></td>
				</tr>
			</table>
		</div>
		<div class="recommendBOX_img">
			<?=$span?>		
			<img src="<?=Yii::app()->params['prizePath'].'/'.$row->prize->pic?>" width="320" height="240" />
		</div>
		<div class="recommendBOX_Status">
			<?php 
			if($row->status==1){
				$timeArr[$row['serial']] = strtotime($row->starttime)-time();
			?>
			<strong><a href="###" id="time_<?=$row['serial']?>" >&nbsp;</a></strong>
			<?php
			}else{
				echo count($row->records).'/'.$row->people;
			}
			?>			
		</div>
		</a>
	</div>
	<?php
		}
	}	
	?>	
	<div class="recommend_bottom"></div>
</div>
<script>
$(document).ready(function() {
<?php
if($timeArr){
?>
RF = new Object();
<?php
	foreach($timeArr as $tKey=>$tValue){
?>
RF['<?=$tKey?>'] = '<?=$tValue?>';
<?php
	}
?>
for ($f in RF) {
	if ($f == null) { 
		continue;
	}
	onTimer($f,RF[$f],changeShowTimeRight,onTimeEndRight);
}
<?php
}
?>
});
 
// 该函数用于显示倒计时
function changeShowTimeRight(id,time) {
    /* 该函数内编写显示倒计时的语句 */  
    $(id).html(time);    
}
//倒計時結束的時候執行的函數
function onTimeEndRight(id){
	$.post('<?php echo CHtml::normalizeUrl(array('/activity/opration'));?>',{'serial':id}, function (data) {
		var ret = $.parseJSON(data);
		location.reload(true);
	});
}
</script>